package com.zhiyi.app.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 基本控制器，控制页面跳转
 * @author shichenyang
 */
@Controller
public class IndexController {
    /**
     * 默认打开的主页
     * @return
     */
    @RequestMapping("/")
    public String index(){
        return "index";
    }

    /**
     * 帮助跳转页面
     * @param viewName
     * @return
     */
    @RequestMapping("/to/{name}")
    public String to(@PathVariable("name") String viewName){
        return viewName;
    }
}
